<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>w1002_windowObject</title>
		<script>
			window.onload=function(){
				var childWin;
				document.getElementById("btn01").onclick=function(){
				//현재 window의 current url
				location.href="http://www.naver.com";
				};
				document.getElementById("btn02").onclick=function(){
				location.assign("http://www.naver.com");
				};
				//뒤로가기 지원 안됨.
				document.getElementById("btn03").onclick=function(){
				location.replace("http://www.naver.com");
				};
				//새로고침
				document.getElementById("btn04").onclick=function(){
				location.reload();
				};
				document.getElementById("btn05").onclick=function(){
				alert(history.length);
				};
				//이전페이지
				document.getElementById("btn06").onclick=function(){
				history.back();
				};
				//최근 페이지
				document.getElementById("btn07").onclick=function(){
				history.forward();
				};
				document.getElementById("btn08").onclick=function(){
				history.go(-2);
				};
				
			
			};
		</script>
	</head>
	<body>
		<button id="btn01">location.href</button>
		<button id="btn02">location.assign()</button>
		<button id="btn03">location.replace()</button>
		<button id="btn04">location.reload()</button>
		
		<hr/>
		<h2>history객체</h2>
		<button id="btn05">history.length</button>
		<button id="btn06">history.back()</button>
		<button id="btn07">history.forward()</button>
		<button id="btn08">history.go()</button>
	</body>
</html>
